﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eTerm.NetSocket.PlugIn
{
    public interface IPlugIn
    {
        /// <summary>
        /// 插件执行完成.
        /// </summary>
        event EventHandler<PlugInArgs> OnExecuted;

        /// <summary>
        /// 插件执行异常.
        /// </summary>
        event EventHandler<PlugInArgs> OnPlugInException;

        /// <summary>
        /// 插件名称.
        /// </summary>
        /// <value>The name of the plug in.</value>
        string PlugInName { get; }

        /// <summary>
        /// 插件指令.
        /// <remarks>
        ///     以!开头的插件指令
        /// </remarks>
        /// </summary>
        /// <value>The plug in CMD.</value>
        string PlugInCmd { get; }

        ///// <summary>
        ///// 是否将该指含串合并一次发送
        ///// </summary>
        //bool IsMerger { get; set; }


        /// <summary>
        /// 执行指令插件.
        /// </summary>
        /// <param name="eTermSession">eTerm配置会话.</param>
        /// <param name="TSession">客户端会话.</param>
        /// <param name="Packet">用户指令包.</param>
        void Execute(BaseTermSocket eTermSession,eTerm363Session TSession,string Packet);

        /// <summary>
        /// 插件帮助信息.
        /// </summary>
        /// <value>The description.</value>
        string Description { get; }

        /// <summary>
        /// 是否为系统插件
        /// </summary>
        bool IsSystem { get; }

        /// <summary>
        /// API用户是否允许使用该插件
        /// </summary>
        bool AllowAPISession {
            get;
        }

        
    }
}
